using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core.common;
using ibba.agil.core;

namespace ibba.agil.data.data
{
    public class tbagi022TipoEvenKey : IDataKey
    {
        public String codTipoEven { get; set; }
    }

    public class tbagi022TipoEven_COL : CollectionData<tbagi022TipoEvenKey, tbagi022TipoEven_ENT>
    {
        private manager.tbagi022TipoEven_COM _manager;
        private Criteria<CriteriaInfo, object> _pesquisa;

        public tbagi022TipoEven_COL()
        {
            _manager = new manager.tbagi022TipoEven_COM();
        }

        public override List<tbagi022TipoEven_ENT> Find(tbagi022TipoEvenKey key)
        {
            #region Implementacao do Criterio de Pesquisa

            _pesquisa = new Criteria<CriteriaInfo, object>(new tbagi022TipoEven_ENT());
            //_pesquisa.Add(new CriteriaInfo()
            //{
            //    EntityData = new tbagi022TipoEven_ENT(),
            //    LikePattern = LikePattern.Both,
            //    LogicalType = LogicalOperator.AND,
            //    NameProperty = "codTipoEven",
            //    SearchType = LogicalComparator.EQUAL
            //}, key.codTipoEven);

            #endregion

            return _manager.Where(CriteriaFind);
        }

        protected override Criteria<CriteriaInfo, object> CriteriaFind()
        {
            return _pesquisa;
        }
    }
}
